package com.jbm.onehome.iface;

import javax.persistence.*;
import com.jbm.core.iface.IAcross;
import java.sql.Timestamp;

/**
 * Created by lyh on 2017-02-22.
 */
@Entity
@Table(name = "info_attachment", schema = "", catalog = "")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
public class InfoAttachmentEntity extends IAcross
{
	public InfoAttachmentEntity()
	{
		super();
	}

	public InfoAttachmentEntity(IAcross ia)
	{
		super(ia);
	}

    private static final long serialVersionUID = 8134858775528950437L;
    private int infoAttId;
    private Integer infoId;
    private String attType;
    private String attPath;
    private String thumAttPath;
    private String attOrgname;
    private Timestamp createDate;
    private Integer createId;
    private byte[]  picByte;


    @Id
    @GeneratedValue
    @Column(name = "info_att_id")
    public int getInfoAttId() {
        return infoAttId;
    }

    public void setInfoAttId(int infoAttId) {
        this.infoAttId = infoAttId;
    }

    @Basic
    @Column(name = "info_id")
    public Integer getInfoId() {
        return infoId;
    }

    public void setInfoId(Integer infoId) {
        this.infoId = infoId;
    }

    @Basic
    @Column(name = "att_type")
    public String getAttType() {
        return attType;
    }

    public void setAttType(String attType) {
        this.attType = attType;
    }

    @Basic
    @Column(name = "att_path")
    public String getAttPath() {
        return attPath;
    }

    public void setAttPath(String attPath) {
        this.attPath = attPath;
    }

    @Basic
    @Column(name = "thum_att_path")
    public String getThumAttPath() {
        return thumAttPath;
    }

    public void setThumAttPath(String thumAttPath) {
        this.thumAttPath = thumAttPath;
    }

    @Basic
    @Column(name = "att_orgname")
    public String getAttOrgname() {
        return attOrgname;
    }

    public void setAttOrgname(String attOrgname) {
        this.attOrgname = attOrgname;
    }

    @Basic
    @Column(name = "create_date")
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "create_id")
    public Integer getCreateId() {
        return createId;
    }

    public void setCreateId(Integer createId) {
        this.createId = createId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        InfoAttachmentEntity that = (InfoAttachmentEntity) o;

        if (infoAttId != that.infoAttId) return false;
        if (attOrgname != null ? !attOrgname.equals(that.attOrgname) : that.attOrgname != null) return false;
        if (attPath != null ? !attPath.equals(that.attPath) : that.attPath != null) return false;
        if (attType != null ? !attType.equals(that.attType) : that.attType != null) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (createId != null ? !createId.equals(that.createId) : that.createId != null) return false;
        if (infoId != null ? !infoId.equals(that.infoId) : that.infoId != null) return false;
        if (thumAttPath != null ? !thumAttPath.equals(that.thumAttPath) : that.thumAttPath != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = infoAttId;
        result = 31 * result + (infoId != null ? infoId.hashCode() : 0);
        result = 31 * result + (attType != null ? attType.hashCode() : 0);
        result = 31 * result + (attPath != null ? attPath.hashCode() : 0);
        result = 31 * result + (thumAttPath != null ? thumAttPath.hashCode() : 0);
        result = 31 * result + (attOrgname != null ? attOrgname.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        result = 31 * result + (createId != null ? createId.hashCode() : 0);
        return result;
    }

//    public DocInputStream getInputStream() {
//        return inputStream;
//    }
//
//    public void setInputStream(DocInputStream inputStream) {
//        this.inputStream = inputStream;
//    }

    @Transient
    public byte[] getPicByte() {
        return picByte;
    }

    public void setPicByte(byte[] picByte) {
        this.picByte = picByte;
    }

    @Transient
    public boolean back;
    @Transient
    public String method;
    @Transient
    public String errorinfo;
    @Transient
    public int count;
    @Transient
    public int start=0;
    @Transient
    public int pagesize=0;
    @Transient
    public Integer tableid;
}
